package com.karrim.server.io.sql.util;

/**
 *
 * @author andrea.cantafio
 */
public class Field {

    public Field(String name, String type) {
        this(name, type, true);
    }

    public Field(String name, String type, boolean nullable) {
        this.name = name;
        this.nullable = nullable;
        this.type = type;
    }

    public Class<?> getJavaType() {
        return javaType;
    }

    public String getName() {
        return name;
    }

    public String getType() {
        return type;
    }

    public boolean isNullable() {
        return nullable;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setJavaType(Class<?> javaType) {
        this.javaType = javaType;
    }

    public void setJavaType(String javaType) throws ClassNotFoundException {
        this.javaType = Class.forName(javaType);
    }
    private Class<?> javaType;
    private String name;
    private boolean nullable;
    private String type;
}
